
<c:choose>
<c:when test='<%= tabs2.equals("New") %>'>

<%
List<CollStudent> collStudentsNew = CollStudentLocalServiceUtil.getByStatus(0);
SearchContainer searchContainer = new SearchContainer(renderRequest, null, null, SearchContainer.DEFAULT_CUR_PARAM, 5, tabs2URL, null, "");
List newResults = ListUtil.subList(collStudentsNew, searchContainer.getStart(), searchContainer.getEnd());
int total = collStudentsNew.size();
searchContainer.setTotal(total);

%>

<center>
<table class="taglib-search-iterator" style="width:100%" cellspacing="0" cellpadding="2">
	<tr class='results-header'>
		<th><liferay-ui:message key="sNo" /></th>
		<th><liferay-ui:message key="first-name" /></th>	
		<th><liferay-ui:message key="middle-name" /></th>
		<th><liferay-ui:message key="last-name" /></th>
		<th></th>
	</tr>	

<%
for(int i=0; i<newResults.size(); i++){

		CollStudent collStudent = (CollStudent) newResults.get(i);		
		
		String className = ( ( i%2 == 0 ) ? "portlet-section-body results-row" : "portlet-section-body results-row alt"); 
		String classNameHover = className+" hover";%>
		<tr class='<%= className %>'; onmouseout="this.className = '<%=className%>'" onmouseover="this.className = '<%=classNameHover%>'"> 
			
			<td><%= Integer.toString(searchContainer.getStart() + i + 1)%></td>
			<td><%= collStudent.getFirstName() %></td>
			<td><%= collStudent.getMiddleName() %></td>
			<td><%= collStudent.getLastName() %></td>
			<td>
			<liferay-ui:icon-menu>
				<portlet:actionURL windowState="<%= WindowState.NORMAL.toString() %>" var="viewCollStudent">
				<portlet:param name="struts_action" value="/ext/registration/campusRegistration" />
				<portlet:param name="<%= Constants.CMD %>" value="viewCollStudent" />
				<portlet:param name="collStudentId" value="<%= String.valueOf(collStudent.getCollStudentId()) %>" />
				</portlet:actionURL>
				<liferay-ui:icon image="preview" message="View" url="<%= viewCollStudent %>" />
				<portlet:actionURL windowState="<%= WindowState.NORMAL.toString() %>" var="approveCollStudent">
				<portlet:param name="struts_action" value="/ext/registration/campusRegistration" />
				<portlet:param name="<%= Constants.CMD %>" value="approveCollStudent" />
				<portlet:param name="collStudentId" value="<%= String.valueOf(collStudent.getCollStudentId()) %>" />
				</portlet:actionURL>
				<liferay-ui:icon image="add_user" message="Approve" url="<%= approveCollStudent %>" />
			</liferay-ui:icon-menu>
			</td>
		
		</tr>
		
<%	
}
%>
</table>
</center>

<div class="taglib-search-iterator-page-iterator-bottom">
	<liferay-ui:search-paginator searchContainer="<%= searchContainer %>" />
</div>

</c:when>

<c:when test='<%= tabs2.equals("Approved") %>'>

<%
List<CollStudent> collStudentsApproved = CollStudentLocalServiceUtil.getByStatus(1);


SearchContainer searchContainer = new SearchContainer(renderRequest, null, null, SearchContainer.DEFAULT_CUR_PARAM, 5, tabs2URL, null, "");
List approvedResults = ListUtil.subList(collStudentsApproved, searchContainer.getStart(), searchContainer.getEnd());
int total = collStudentsApproved.size();
searchContainer.setTotal(total);
%>

<center>
<table class="taglib-search-iterator" style="width:100%" cellspacing="0" cellpadding="2">
	<tr class='results-header'>
		<th><liferay-ui:message key="sNo" /></th>
		<th><liferay-ui:message key="first-name" /></th>	
		<th><liferay-ui:message key="middle-name" /></th>
		<th><liferay-ui:message key="last-name" /></th>
		<th></th>
	</tr>	

<%
for(int i=0; i<approvedResults.size(); i++){

		CollStudent collStudent = (CollStudent) approvedResults.get(i);
		String className = ( ( i%2 == 0 ) ? "portlet-section-body results-row" : "portlet-section-body results-row alt"); 
		String classNameHover = className+" hover";%>
		<tr class='<%= className %>'; onmouseout="this.className = '<%=className%>'" onmouseover="this.className = '<%=classNameHover%>'"> 
			
			<td><%= Integer.toString(searchContainer.getStart() + i + 1)%></td>
			<td><%= collStudent.getFirstName() %></td>
			<td><%= collStudent.getMiddleName() %></td>
			<td><%= collStudent.getLastName() %></td>
			<td>
			<liferay-ui:icon-menu>
				<portlet:actionURL windowState="<%= WindowState.MAXIMIZED.toString() %>" var="viewCollStudent">
				<portlet:param name="struts_action" value="/ext/registration/campusRegistration" />
				<portlet:param name="<%= Constants.CMD %>" value="viewCollStudent" />
				<portlet:param name="collStudentId" value="<%= String.valueOf(collStudent.getCollStudentId()) %>" />
				</portlet:actionURL>
				<liferay-ui:icon image="preview" message="View" url="<%= viewCollStudent %>" />
				<portlet:actionURL windowState="<%= WindowState.MAXIMIZED.toString() %>" var="removeCollStudent">
				<portlet:param name="struts_action" value="/ext/registration/campusRegistration" />
				<portlet:param name="<%= Constants.CMD %>" value="removeCollStudent" />
				<portlet:param name="collStudentId" value="<%= String.valueOf(collStudent.getCollStudentId()) %>" />
				</portlet:actionURL>
				<liferay-ui:icon image="remove" message="Remove" url="<%= removeCollStudent %>" />
			</liferay-ui:icon-menu>
			</td>
		
		</tr>
		
<%	
}
%>
</table>
</center>
<div class="taglib-search-iterator-page-iterator-bottom">
	<liferay-ui:search-paginator searchContainer="<%= searchContainer %>" />
</div>
</c:when>


<c:when test='<%= tabs2.equals("Pending") %>'>

<%
List<CollStudent> collStudentsPending = CollStudentLocalServiceUtil.getByStatus(2);


SearchContainer searchContainer = new SearchContainer(renderRequest, null, null, SearchContainer.DEFAULT_CUR_PARAM, 5, tabs2URL, null, "");
List pendingResults = ListUtil.subList(collStudentsPending, searchContainer.getStart(), searchContainer.getEnd());
int total = collStudentsPending.size();
searchContainer.setTotal(total);

%>

<center>
<table class="taglib-search-iterator" style="width:100%" cellspacing="0" cellpadding="2">
	<tr class='results-header'>
		<th><liferay-ui:message key="sNo" /></th>
		<th><liferay-ui:message key="first-name" /></th>	
		<th><liferay-ui:message key="middle-name" /></th>
		<th><liferay-ui:message key="last-name" /></th>
		<th></th>
	</tr>
<%
for(int i=0; i<pendingResults.size(); i++){

		CollStudent collStudent = (CollStudent) pendingResults.get(i);
		
		String className = ( ( i%2 == 0 ) ? "portlet-section-body results-row" : "portlet-section-body results-row alt"); 
		String classNameHover = className+" hover";%>
		<tr class='<%= className %>'; onmouseout="this.className = '<%=className%>'" onmouseover="this.className = '<%=classNameHover%>'"> 
			
			<td><%= Integer.toString(searchContainer.getStart() + i + 1)%></td>
			<td><%= collStudent.getFirstName() %></td>
			<td><%= collStudent.getMiddleName() %></td>
			<td><%= collStudent.getLastName() %></td>
			<td>
			<liferay-ui:icon-menu>
				<portlet:actionURL windowState="<%= WindowState.MAXIMIZED.toString() %>" var="viewCollStudent">
				<portlet:param name="struts_action" value="/ext/registration/campusRegistration" />
				<portlet:param name="<%= Constants.CMD %>" value="viewCollStudent" />
				<portlet:param name="collStudentId" value="<%= String.valueOf(collStudent.getCollStudentId()) %>" />
				</portlet:actionURL>
				<liferay-ui:icon image="preview" message="View" url="<%= viewCollStudent %>" />
				<portlet:actionURL windowState="<%= WindowState.MAXIMIZED.toString() %>" var="approveCollStudent">
				<portlet:param name="struts_action" value="/ext/registration/campusRegistration" />
				<portlet:param name="<%= Constants.CMD %>" value="approveCollStudent" />
				<portlet:param name="collStudentId" value="<%= String.valueOf(collStudent.getCollStudentId()) %>" />
				</portlet:actionURL>
				<liferay-ui:icon image="add_user" message="Approve" url="<%= approveCollStudent %>" />
			</liferay-ui:icon-menu>
			</td>
		
		</tr>
		
<%	
}
%>
</table>
</center>
<div class="taglib-search-iterator-page-iterator-bottom">
	<liferay-ui:search-paginator searchContainer="<%= searchContainer %>" />
</div>
</c:when>
<c:when test='<%= tabs2.equals("Rejected") %>'>

<%
List<CollStudent> collStudentsRejected = CollStudentLocalServiceUtil.getByStatus(3);


SearchContainer searchContainer = new SearchContainer(renderRequest, null, null, SearchContainer.DEFAULT_CUR_PARAM, 5, tabs2URL, null, "");
List rejectedResults = ListUtil.subList(collStudentsRejected, searchContainer.getStart(), searchContainer.getEnd());
int total = collStudentsRejected.size();
searchContainer.setTotal(total);
%>

<center>
<table class="taglib-search-iterator" style="width:100%" cellspacing="0" cellpadding="2">
	<tr class='results-header'>
		<th><liferay-ui:message key="sNo" /></th>
		<th><liferay-ui:message key="first-name" /></th>	
		<th><liferay-ui:message key="middle-name" /></th>
		<th><liferay-ui:message key="last-name" /></th>
		<th></th>
	</tr>
<%
for(int i=0; i<rejectedResults.size(); i++){

		CollStudent collStudent = (CollStudent) rejectedResults.get(i);
		String className = ( ( i%2 == 0 ) ? "portlet-section-body results-row" : "portlet-section-body results-row alt"); 
		String classNameHover = className+" hover";%>
		<tr class='<%= className %>'; onmouseout="this.className = '<%=className%>'" onmouseover="this.className = '<%=classNameHover%>'"> 
			
			<td><%= Integer.toString(searchContainer.getStart() + i + 1)%></td>
			<td><%= collStudent.getFirstName() %></td>
			<td><%= collStudent.getMiddleName() %></td>
			<td><%= collStudent.getLastName() %></td>
			<td>
			<liferay-ui:icon-menu>
				<portlet:actionURL windowState="<%= WindowState.MAXIMIZED.toString() %>" var="viewCollStudent">
				<portlet:param name="struts_action" value="/ext/registration/campusRegistration" />
				<portlet:param name="<%= Constants.CMD %>" value="viewCollStudent" />
				<portlet:param name="collStudentId" value="<%= String.valueOf(collStudent.getCollStudentId()) %>" />
				</portlet:actionURL>
				<liferay-ui:icon image="preview" message="View" url="<%= viewCollStudent %>" />
				<portlet:actionURL windowState="<%= WindowState.MAXIMIZED.toString() %>" var="approveCollStudent">
				<portlet:param name="struts_action" value="/ext/registration/campusRegistration" />
				<portlet:param name="<%= Constants.CMD %>" value="approveCollStudent" />
				<portlet:param name="collStudentId" value="<%= String.valueOf(collStudent.getCollStudentId()) %>" />
				</portlet:actionURL>
				<liferay-ui:icon image="add_user" message="Approve" url="<%= approveCollStudent %>" />
			</liferay-ui:icon-menu>
			</td>
		
		</tr>
		
<%	
}
%>
</table>
</center>
<div class="taglib-search-iterator-page-iterator-bottom">
	<liferay-ui:search-paginator searchContainer="<%= searchContainer %>" />
</div>
</c:when>
</c:choose>